#include "stdafx.h"
#ifndef __SPREAD_SHEET_H__
#define __SPREAD_SHEET_H__
#include "SpreadsheetCell.h"

class SpreadsheetApplication;

class Spreadsheet {
public:
	~Spreadsheet();
	Spreadsheet(int w, int h, const SpreadsheetApplication& theApp);
	void setCellAt(int x, int y, const SpreadsheetCell& sprCell);
	SpreadsheetCell getCellAt(int x, int y);
	void display();
	int getId() const;

private:
	void copyFromOtherSpreadsheet(const Spreadsheet& ob);

protected:
	static int sCounter;
	int mId;
	bool inRange(int min, int max);
	int mWidth;
	int mHeight;
	SpreadsheetCell **mCells;
	/**
	const reference SpreadsheetApplication data member can only be used to call const methods
	on the SpreadsheetApplication object
	*/
	const SpreadsheetApplication& mTheApp;
	Spreadsheet(const Spreadsheet& src);
	Spreadsheet& operator=(const Spreadsheet& rhf);
};

#endif
